#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
void add_comma(int n, int sz, int num)
{
    static int count = 0;
    int k = n % 10;
    if(n > 9)
    {
        add_comma(n / 10, sz, num);
    }
    int pr = num % sz;
    if (count % sz == pr && count != 0)
    {
        printf(",");
    }
    printf("%d", k);
    count++;
}
int main()
{
    int n = 0;
    scanf("%d", &n);
    int num = 0;
    int temp = n;
    while (temp > 0)
    {
        num++;
        temp /= 10;
    }
    add_comma(n, 3, num);
    return 0;
}